﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CodeAuto.Pages
{
    public partial class ProjectTables : System.Web.UI.Page
    {
        public bool IsLogin = false;
        public Models.T_Project project = null;
        public List<Models.T_Table> tables = new List<Models.T_Table>();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.RegisterHyperLink.NavigateUrl = "/Default.aspx";
            if (Session["user"] != null)
            {
                DavidDB.ADO.DBManager db = new DavidDB.ADO.DBManager();
                IsLogin = true;
                int id = 1;
                int.TryParse(Request.QueryString["docid"], out id);
                Models.T_Table t = new Models.T_Table();
                t.ProjectId = id;
                var query = db.GetSomeObject(t);
                foreach (Models.T_Table q in query)
                {
                    tables.Add(q);
                }
                project = new Models.T_Project();
                project.Id = id;
                project = db.GetModel(project);
                db.Commit();
                db.Dispose();
            }
        }
    }
}